﻿@using mscook.mvc;
@{
    ViewBag.Title = "览月齐鲁";
    Layout = "~/Views/Shared/_CenterLayout.cshtml";
}

@model mscook.mvc.Models.CenterBounsBuyModel
@section JavaScript
{
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.unobtrusive.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.unobtrusive-ajax.js")"></script>

    <script>
        $(function () {
          
            $("#submit").click(function () {
                var url = "@Url.Action("Alibuy")";
                var bonusBuyId = $("#bonusBuyId").val();
                var phone = $("#Phone").val();
                alert("请您在支付时选择及时到账,以免工作人员疏忽耽误您的时间");
                $.ajax({
                    type: "Post",
                    url: url,
                    data: { bonusBuyId: bonusBuyId, phone: phone },
                    dataType: "html",
                    success: function (data) {
                        $("#alipay").html(data);
                    },
                    error: function (msg) {
                        alert("信息填写有误");
                    }
                });
            });
        });

    </script>
}

<div class="hide" id="alipay"></div>
<div class="span9 main">
    <div class="row">

        <div class="span8 business_card highlight">
            <div class="card_header">
                <span class="card_title">
                    <i class=" icon-barcode"></i>
                    <a target="_blank" href="#">修改资料 <i class="chevron-right">›</i></a>
                </span>
            </div>
            <div class="card_info">
                <form class="form-horizontal">
                    @Html.AntiForgeryToken()
                    <div class="control-group">
                        <label class="control-label">
                        </label>
                        <div class="controls">
                            @Html.Encode("建议您选择即时到账方式付款，以免由于工作疏忽不能即时确认您的订单")
                            @Html.ValidationSummary()
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">购买积分</label>
                        <div class="controls">

                            <select id="bonusBuyId">
                                @foreach(var bonusBuy in Model.BonusBuyList)
                                {
                                    <option value="@bonusBuy.Id">@Html.Encode(string.Format("{0}元兑换{1}积分",bonusBuy.Price,bonusBuy.Bonus))</option>                                }

                            </select>

                           
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">联系电话</label>
                        <div class="controls">

                            @Html.TextBoxFor(o => o.Phone, new { placeholder = "请填写您的联系电话" })

                            <span class="help-inline">@Html.ValidationMessageFor(o => o.Phone)</span>
                        </div>
                    </div>



                    <div class="form-actions">
                        <button type="button" id="submit" class="btn btn-inverse">保存</button>
                        <button type="reset" class="btn">取消</button>
                    </div>

                </form>
            </div>
        </div>

    </div>
</div>
